<?php

namespace App\Model;

use App\Common\Model\ShopAccount;
use Illuminate\Database\Eloquent\Model;

class MoneyReport extends Model
{
    //与数据表进行关联
    protected $table = 'money_report';
    //数据库时间戳开关
    public $timestamps = false;
    //数据库批量赋值开关
    protected $fillable =
    [
        'uid','types',
        'amount','status',
        'remark','create_time',
        'update_time',
        'provider_uid'
    ];
    //查询贡献者的名字
    public function providerName(){
        return self::hasOne(ShopAccount::class,'uid','provider_uid')->withDefault([
            'name'=>'未知'
        ]);
    }


}
